/*
 * CDebugDraw.h
 *
 *  Created on: Sep 7, 2011
 *      Author: welcome
 */

#ifndef CDEBUGDRAW_H_
#define CDEBUGDRAW_H_

#include <Box2D/Box2D.h>
#include <GLES/gl.h>
#include <LinearMath/btIDebugDraw.h>
#include <LinearMath/btVector3.h>

struct b2AABB;

namespace GGEngine {

#define DEGREES_TO_RADIANS(x) (b2_pi * x / 180.0)

class CDebugDraw: public b2Draw, public btIDebugDraw {

public:
	CDebugDraw();

	virtual ~CDebugDraw();

public:
	void DrawPolygon(const b2Vec2* vertices, int32 vertexCount,
			const b2Color& color);

	void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount,
			const b2Color& color);

	void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color);

	void DrawSolidCircle(const b2Vec2& center, float32 radius,
			const b2Vec2& axis, const b2Color& color);

	void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color);

	void DrawTransform(const b2Transform& xf);

	void DrawPoint(const b2Vec2& p, float32 size, const b2Color& color);

	void DrawString(int x, int y, const char* string, ...);

	void DrawAABB(b2AABB* aabb, const b2Color& color);

	virtual void drawLine(const btVector3& from, const btVector3& to,
			const btVector3& color);

	virtual void	drawSphere (const btVector3& p, btScalar radius, const btVector3& color);

	virtual void	drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color);

	virtual void	reportErrorWarning(const char* warningString);

	virtual void	draw3dText(const btVector3& location,const char* textString);

	virtual void	setDebugMode(int debugMode);

	virtual int		getDebugMode() const;
private :
	int debugMode;
};

} /* namespace GGEngine */
#endif /* CDEBUGDRAW_H_ */
